package cn.cds.withyou.lib.model;

import android.database.Cursor;

import java.io.Serializable;
import java.sql.Timestamp;

import cn.cds.withyou.lib.Constants;

/**
 * <p> Description: </p>
 * <p/>
 * <p> Copyright: Copyright (c) 2016 </p>
 *
 * @author: Json.Lee
 * @Version: 1.0
 * @CreateTime: 2/5/2016 22:22
 */
public class ArenaBookDto implements Serializable {

    private String id;
    private String arenaId;
    private String spaceId;
    private long startT;
    private long endT;
    private String userId;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getArenaId() {
        return arenaId;
    }

    public void setArenaId(String arenaId) {
        this.arenaId = arenaId;
    }

    public String getSpaceId() {
        return spaceId;
    }

    public void setSpaceId(String spaceId) {
        this.spaceId = spaceId;
    }

    public long getStartT() {
        return startT;
    }

    public void setStartT(long startT) {
        this.startT = startT;
    }

    public long getEndT() {
        return endT;
    }

    public void setEndT(long endT) {
        this.endT = endT;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public ArenaBookDto () {

    }

    public ArenaBookDto (Cursor result) {
        id = result.getString(result.getColumnIndex(Constants._ID));
        arenaId = result.getString(result.getColumnIndex(Constants.ArenaBooking._ARENA_ID));
        spaceId = result.getString(result.getColumnIndex(Constants.ArenaBooking._SPACE_ID));
        startT = Timestamp.valueOf(result.getString(result.getColumnIndex(Constants.ArenaBooking._START_TIME))).getTime();
        endT = Timestamp.valueOf(result.getString(result.getColumnIndex(Constants.ArenaBooking._END_TIME))).getTime();
        userId = result.getString(result.getColumnIndex(Constants.ArenaBooking._USER_ID));
    }
}
